<!DOCTYPE html>
<html>


<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>组卷策略</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="${ctx}/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="${ctx}/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="${ctx}/css/plugins/steps/jquery.steps.css" rel="stylesheet">
    <link href="${ctx}/css/animate.min.css" rel="stylesheet">
    <link href="${ctx}/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="${ctx}/css/labelauty.css" rel="stylesheet" />

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-md-12">
            <input type="hidden" id="basePath" value="${ctx}">
            <div class="ibox">
                <div class="ibox-content">
                    <h2>组卷策略</h2>
                    <form id="form" class="form-horizontal">
                        <h1>第一站问答</h1>
                        <fieldset>
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <label class="col-md-1 control-label" style="color: #000077;">第一题</label>
                                        <div class="col-md-1">
											<span style="color: #000077;"><h3>腧穴题</h3>
											</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-1 control-label">数量(套)</label>
                                        <div class="col-md-2">
                                            <input disabled="disabled" value="40" type="number"
                                                   class="form-control" max="20" min="0" placeholder="0"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-1 control-label" style="color: #000077;">第二题</label>
                                        <div class="col-md-1">
											<span style="color: #000077;"><h3>问答题</h3>
											</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-xs-1 control-label">内科(套)</label>
                                        <div class="col-xs-2">
                                            <input name="exam2nk" id="exam2nk" type="number"
                                                   class="form-control" max="20" min="0" placeholder="0"/>
                                        </div>
                                        <label class="col-xs-1 control-label">伤科(套)</label>
                                        <div class="col-xs-2">
                                            <input name="exam2sk" id="exam2sk" type="number"
                                                   class="form-control" max="20" min="0" placeholder="0"/>
                                        </div>
                                        <label class="col-xs-1 control-label">妇科(套)</label>
                                        <div class="col-xs-2">
                                            <input name="exam2fk" id="exam2fk" type="number"
                                                   class="form-control" max="20" min="0" placeholder="0"/>
                                        </div>
                                        <label class="col-xs-1 control-label">儿科(套)</label>
                                        <div class="col-xs-2">
                                            <input name="exam2ek" id="exam2ek" type="number"
                                                   class="form-control" max="20" min="0" placeholder="0"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-xs-1 control-label">触诊(套)</label>
                                        <div class="col-xs-2">
                                            <input name="exam2cz" id="exam2cz" type="number"
                                                   class="form-control" max="20" min="0" placeholder="0"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-md-1 control-label" style="color: #000077;">第三题</label>
                                        <div class="col-md-1">
											<span style="color: #000077;"><h3>问答题</h3>
											</span>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-xs-1 control-label">内科(套)</label>
                                        <div class="col-xs-2">
                                            <input name="exam3nk" id="exam3nk" type="number"
                                                   class="form-control" max="20" min="0" placeholder="0"/>
                                        </div>
                                        <label class="col-xs-1 control-label">伤科(套)</label>
                                        <div class="col-xs-2">
                                            <input name="exam3sk" id="exam3sk" type="number"
                                                   class="form-control" max="20" min="0" placeholder="0"/>
                                        </div>
                                        <label class="col-xs-1 control-label">妇科(套)</label>
                                        <div class="col-xs-2">
                                            <input name="exam3fk" id="exam3fk" type="number"
                                                   class="form-control" max="20" min="0" placeholder="0"/>
                                        </div>
                                        <label class="col-xs-1 control-label">儿科(套)</label>
                                        <div class="col-xs-2">
                                            <input name="exam3ek" id="exam3ek" type="number"
                                                   class="form-control" max="20" min="0" placeholder="0"/>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-xs-1 control-label">触诊(套)</label>
                                        <div class="col-xs-2">
                                            <input name="exam3cz" id="exam3cz" type="number"
                                                   class="form-control" max="20" min="0" placeholder="0"/>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </fieldset>
                        <h1>第二站常规化</h1>
                        <fieldset>
                            <div class="row">
                                <div class="form-group">
                                    <label class="col-md-1 control-label" style="color: #000077;">第一题</label>
                                    <div class="col-md-2">
											<span style="color: #000077;"><h3>穴位定位</h3>
											</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-1 control-label">穴位(1)</label>
                                    <div class="col-md-2">
                                        <select class="form-control" name="pattern2exam11" id="pattern2exam11">
                                            <option value="">请选择</option>
                                            <option value="07">儿科穴位</option>
                                            <option value="08">成人穴位</option>
                                        </select>
                                    </div>
                                    <label class="col-md-1 control-label">穴位(2)</label>
                                    <div class="col-md-2">
                                        <select class="form-control" name="pattern2exam12" id="pattern2exam12">
                                            <option value="">请选择</option>
                                            <option value="07">儿科穴位</option>
                                            <option value="08">成人穴位</option>
                                        </select>
                                    </div>
                                    <label class="col-md-1 control-label">穴位(3)</label>
                                    <div class="col-md-2">
                                        <select class="form-control" name="pattern2exam13" id="pattern2exam13">
                                            <option value="">请选择</option>
                                            <option value="07">儿科穴位</option>
                                            <option value="08">成人穴位</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-1 control-label">穴位(4)</label>
                                    <div class="col-md-2">
                                        <select class="form-control" name="pattern2exam14" id="pattern2exam14">
                                            <option value="">请选择</option>
                                            <option value="07">儿科穴位</option>
                                            <option value="08">成人穴位</option>
                                        </select>
                                    </div>
                                    <label class="col-md-1 control-label">穴位(5)</label>
                                    <div class="col-md-2">
                                        <select class="form-control" name="pattern2exam15" id="pattern2exam15">
                                            <option value="">请选择</option>
                                            <option value="07">儿科穴位</option>
                                            <option value="08">成人穴位</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-md-1 control-label" style="color: #000077;">第二题</label>
                                    <div class="col-md-2">
											<span style="color: #000077;"><h3>单项手法</h3>
											</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-1 control-label">手法(1)</label>
                                    <div class="col-md-2">
                                        <select class="form-control" name="pattern2exam21" id="pattern2exam21">
                                            <option value="">请选择</option>
                                            <option value="09">儿科手法</option>
                                            <option value="10">成人手法</option>
                                            <option value="11">触诊诊断</option>
                                        </select>
                                    </div>
                                    <label class="col-md-1 control-label">手法(2)</label>
                                    <div class="col-md-2">
                                        <select class="form-control" name="pattern2exam22" id="pattern2exam22">
                                            <option value="">请选择</option>
                                            <option value="09">儿科手法</option>
                                            <option value="10">成人手法</option>
                                            <option value="11">触诊诊断</option>
                                        </select>
                                    </div>
                                    <label class="col-md-1 control-label">手法(3)</label>
                                    <div class="col-md-2">
                                        <select class="form-control" name="pattern2exam23" id="pattern2exam23">
                                            <option value="">请选择</option>
                                            <option value="09">儿科手法</option>
                                            <option value="10">成人手法</option>
                                            <option value="11">触诊诊断</option>
                                        </select>
                                    </div>

                                    <label class="col-md-1 control-label">手法(4)</label>
                                    <div class="col-md-2">
                                        <select class="form-control" name="pattern2exam24" id="pattern2exam24">
                                            <option value="">请选择</option>
                                            <option value="09">儿科手法</option>
                                            <option value="10">成人手法</option>
                                            <option value="11">触诊诊断</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-1 control-label" style="color: #000077;">第三题</label>
                                    <div class="col-md-2">
											<span style="color: #000077;"><h3>成套手法</h3>
											</span>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-1 control-label">伤科(套)</label>
                                    <div class="col-md-2">
                                        <input name="examsk" id="examsk" type="number"
                                               class="form-control" max="20" min="0" placeholder="0"/>
                                    </div>
                                    <label class="col-md-1 control-label">内科(套)</label>
                                    <div class="col-md-2">
                                        <input name="examnk" id="examnk" type="number"
                                               class="form-control" max="20" min="0" placeholder="0"/>
                                    </div>
                                    <label class="col-md-1 control-label">妇科(套)</label>
                                    <div class="col-md-2">
                                        <input name="examfk" id="examfk" type="number"
                                               class="form-control" max="20" min="0" placeholder="0"/>
                                    </div>
                                    <label class="col-md-1 control-label">儿科(套)</label>
                                    <div class="col-md-2">
                                        <input name="examek" id="examek" type="number"
                                               class="form-control" max="20" min="0" placeholder="0"/>
                                    </div>
                                </div>
                            </div>
                        </fieldset>
                        <h1>第二站客观化</h1>
                        <fieldset>
                            <div class="row">
                                <div class="col-md-12">
                                    <div>
                                        <blockquote>
                                            <p><span style="color: #000077;">第一题穴位定位：</span>10题</p>
                                        </blockquote>
                                        <blockquote>
                                            <p><span style="color: #000077;">第二题单项手法：</span>4题</p>
                                        </blockquote>
                                        <blockquote>
                                            <p><span style="color: #000077;">第三题成套手法：</span>1题</p>
                                        </blockquote>
                                    </div>

                                    <div style="color: red">
                                        <blockquote>
                                            <p>*&nbsp;第一题穴位定位应按照从前到后，从上到下的顺序选择穴位，穴位避免同一经络。</p>
                                            <p>*&nbsp;第二题单项手法在五大类中选择，避免同一大类，同一部位。</p>
                                            <p>*&nbsp;第三题成套手法与第二站常规化成套手法试题一致。</p>
                                        </blockquote>
                                    </div>

                                </div>
                            </div>
                        </fieldset>
                        <h1>完成</h1>
                        <fieldset>
                            <div class="form-group">
                                <div class="col-md-6 text-right">
                                    <input class="rdolist" type="radio" name="strategy" id="zjType1" value="0" checked>
                                    <label class="rdobox">
                                        <span class="check-image"></span>
                                        <span class="radiobox-content">人工组卷</span>
                                    </label>
                                </div>
                                <div class="col-md-6">
                                    <input class="rdolist" type="radio" name="strategy" id="zjType2" value="1">
                                    <label class="rdobox">
                                        <span class="check-image"></span>
                                        <span class="radiobox-content">自动组卷</span>
                                    </label>
                                </div>
                            </div>
                        </fieldset>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
<script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
<script src="${ctx}/js/plugins/steps/jquery.steps.min.js"></script>
<script src="${ctx}/js/plugins/layer/layer.js"></script>
<script src="${ctx}/js/plugins/validate/jquery.validate.min.js"></script>
<script src="${ctx}/js/plugins/validate/validate-methods.js"></script>
<script src="${ctx}/js/plugins/validate/jquery-form.js"></script>
<script src="${ctx}/js/plugins/validate/messages_zh.min.js"></script>
<script src="${ctx}/js/labelauty.js"></script>
<script>
    var param = " ${Request["strategy"]!0}";
    if (param == 1) {
        $("#zjType2").attr("checked", true);
    }
    (function ($) {
        $.extend($.validator.messages, {
            required: "请选择",
        });
    }(jQuery));
    $(document).ready(function () {
        $("#form").steps({
            bodyTag: "fieldset",
            onStepChanging: function (event, currentIndex, newIndex) {
                if (currentIndex > newIndex) {
                    return true;
                }
                var form = $(this);
                if (currentIndex < newIndex) {
                    $(".body:eq(" + newIndex + ") label.error", form).remove();
                    $(".body:eq(" + newIndex + ") .error", form).removeClass("error");
                }
                form.validate().settings.ignore = ":disabled,:hidden";
                return form.valid();
            }
            , onStepChanged: function (event, currentIndex, priorIndex) {
                if (currentIndex === 1) {
                    var exam2nk = $("#exam2nk").val();
                    var exam2sk = $("#exam2sk").val();
                    var exam2ek = $("#exam2ek").val();
                    var exam2fk = $("#exam2fk").val();
                    var exam2cz = $("#exam2cz").val();
                    var exam3nk = $("#exam3nk").val();
                    var exam3sk = $("#exam3sk").val();
                    var exam3ek = $("#exam3ek").val();
                    var exam3fk = $("#exam3fk").val();
                    var exam3cz = $("#exam3cz").val();
                    var count1 = parseInt(exam2nk) + parseInt(exam2sk) + parseInt(exam2ek) + parseInt(exam2fk) + parseInt(exam2cz);
                    if (count1 != 40) {
                        layer.alert('第二题问答题数量相加必须等于40!', {
                            icon: 5,
                            skin: 'layer-ext-moon'
                        })
                        $(this).steps("previous");
                        return;
                    }

                    var count2 = parseInt(exam3nk) + parseInt(exam3sk) + parseInt(exam3ek) + parseInt(exam3fk) + parseInt(exam3cz);
                    if (count2 != 40) {
                        layer.alert('第三题问答题数量相加必须等于40!', {
                            icon: 5,
                            skin: 'layer-ext-moon'
                        })
                        $(this).steps("previous");
                        return;
                    }
                }
                if (currentIndex === 2) {
                    var examnk = $("#examnk").val();
                    var examsk = $("#examsk").val();
                    var examek = $("#examek").val();
                    var examfk = $("#examfk").val();
                    var count = parseInt(examnk) + parseInt(examsk) + parseInt(examek) + parseInt(examfk);
                    if (count != 40) {
                        layer.alert('第三题成套手法数量相加必须等于40!', {
                            icon: 5,
                            skin: 'layer-ext-moon'
                        })
                        $(this).steps("previous");
                        return;
                    }
                }
            }
            , onFinishing: function (event, currentIndex) {
                var form = $(this);
                form.validate().settings.ignore = ":disabled";
                return form.valid();
            },
            onFinished: function (event, currentIndex) {
                var form = $(this);
                $(form).ajaxSubmit({
                    url: "${ctx}/strategy/add",
                    data: $(form).serialize(),
                    type: "POST",
                    dataType: "JSON",
                    success: function (data) {
                        if (data.status == "401") {
                            layer.alert('您没有权限!', {
                                icon: 4,
                                skin: 'layer-ext-moon'
                            })
                        } else if (data.status == "200") {
                            layer.alert('修改成功!', {
                                icon: 1,
                                skin: 'layer-ext-moon'
                            })
                        } else {
                            layer.alert('修改失败!', {
                                icon: 2,
                                skin: 'layer-ext-moon'
                            })
                        }
                    }
                })
            }
        }).validate({
            errorPlacement: function (error, element) {
                element.after(error);
            },
            rules: {
                pattern1exam1: "required",
                pattern1exam2: "required",
                pattern1exam3: "required",
                pattern2exam11: "required",
                pattern2exam12: "required",
                pattern2exam13: "required",
                pattern2exam14: "required",
                pattern2exam15: "required",
                pattern2exam21: "required",
                pattern2exam22: "required",
                pattern2exam23: "required",
                pattern2exam24: "required",
                examsk: "required",
                examek: "required",
                examfk: "required",
                examnk: "required",
                exam2sk: "required",
                exam2ek: "required",
                exam2fk: "required",
                exam2nk: "required",
                exam2cz: "required",
                exam3sk: "required",
                exam3ek: "required",
                exam3fk: "required",
                exam3nk: "required",
                exam3cz: "required",
            }, messages: {
                examsk: "请填写数量",
                examnk: "请填写数量",
                examek: "请填写数量",
                examfk: "请填写数量",
                exam2sk: "请填写数量",
                exam2nk: "请填写数量",
                exam2ek: "请填写数量",
                exam2fk: "请填写数量",
                exam2cz: "请填写数量",
                exam3sk: "请填写数量",
                exam3nk: "请填写数量",
                exam3ek: "请填写数量",
                exam3fk: "请填写数量",
                exam3cz: "请填写数量",
            }
        })
    });
    $(function () {
        $(".rdolist").labelauty("rdolist", "rdo");
        $.getJSON('${ctx}/strategy/data', function (data) {
            var one = data.one;
            var two = data.two;
            if (one != null) {
                $("#exam2sk").val(one.exam2SK);
                $("#exam2fk").val(one.exam2FK);
                $("#exam2nk").val(one.exam2NK);
                $("#exam2ek").val(one.exam2EK);
                $("#exam2cz").val(one.exam2CZ);
                $("#exam3sk").val(one.exam3SK);
                $("#exam3fk").val(one.exam3FK);
                $("#exam3nk").val(one.exam3NK);
                $("#exam3ek").val(one.exam3EK);
                $("#exam3cz").val(one.exam3CZ);
            }
            if (two != null) {
                var exam1 = two.exam1.split(",");
                $("#pattern2exam11").val(exam1[0]);
                $("#pattern2exam12").val(exam1[1]);
                $("#pattern2exam13").val(exam1[2]);
                $("#pattern2exam14").val(exam1[3]);
                $("#pattern2exam15").val(exam1[4]);
                var exam2 = two.exam2.split(",");
                $("#pattern2exam21").val(exam2[0]);
                $("#pattern2exam22").val(exam2[1]);
                $("#pattern2exam23").val(exam2[2]);
                $("#pattern2exam24").val(exam2[3]);
                $("#examsk").val(two.examSK);
                $("#examfk").val(two.examFK);
                $("#examnk").val(two.examNK);
                $("#examek").val(two.examEK);
            }
        })
    })
</script>
</body>

</html>
